package com.wen.mall.search.controller;

import com.wen.mall.search.service.MallSearchService;
import com.wen.mall.search.vo.SearchParam;
import com.wen.mall.search.vo.SearchResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 为`QWQ`
 * @date 2022/9/25
 * @description: TODO
 **/
@Controller
public class SearchController {

    @Autowired
    private MallSearchService mallSearchService;


    @GetMapping("/list.html")
    public String listPage(SearchParam param, Model model){
        SearchResult result = mallSearchService.search(param);
        model.addAttribute("result", result);
        return "list";
    }



}
